package cvc.framework.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cvc.framework.result.RestMessage;
import cvc.framework.result.RestResult;
import cvc.framework.service.TemplateService;

@Controller
@RequestMapping("/templateUrl")
public class TemplateController {
	//访问该地址跳转到template文件夹里的网页
	@RequestMapping("/jump")
	public String templateJump() {
		return "index";
	}
	@Autowired
	private TemplateService service;
	//前端的带参数的get请求
	@RequestMapping("/getParam")
	@ResponseBody
	public RestResult getFrontEnd(String param) {
		RestResult res=new RestResult();
		res.message=new RestMessage();
		res.message.data=service.getParam(param);
		return res;
	}

	@RequestMapping("/config")
	public String config() {
		return "config";
	}
	@RequestMapping("/live")
	public String live() {
		return "live";
	}
	@RequestMapping("/distinguish")
	public String distinguish() {
		return "distinguish";
	}
}
